| 1 | --- |
| 2 | import type { GetStaticPathsResult } from "astro"; |
| 3 | import type { CollectionEntry } from "astro:content"; |
| 4 | import { getCollection, render } from "astro:content"; |
| 5 | import PostLayout from "@/layouts/BlogPost.astro"; |
| 6 | |
| 7 | export async function getStaticPaths(): Promise<GetStaticPathsResult> { |
| 8 | const posts: CollectionEntry<"post">[] = await getCollection("post"); |
| 9 | const params = posts.map((post) => ({ |
| 10 | params: { post: post.id }, |
| 11 | props: { post }, |
| 12 | })); |
| 13 | return params; |
| 14 | } |
| 15 | |
| 16 | interface Props { |
| 17 | post: CollectionEntry<"post">; |
| 18 | } |
| 19 | |
| 20 | const { post } = Astro.props; |
| 21 | const { Content } = await render(post); |
| 22 | --- |
| 23 | |
| 24 | <PostLayout post={post}> |
| 25 | <Content /> |
| 26 | <div class="mt-12"> |
| 27 | <a href={ `mailto:contact@stevedylan.dev?subject=${'Re: ' + post.data.title}` }>Reply via Email</a> |
| 28 | </div> |
| 29 | </PostLayout> |